<template>
  <div id="center_text">
    <div style="float: left">
      <div>
        贷款金额
        <input checked="checked" style="width: 455px;"  placeholder="元" v-model="moneys"/>
      </div><br>
      <div>
        利息总额
        <input checked="checked" style="width: 455px" placeholder="元" v-model="moneys_s"/>
      </div><br>
      <div class="center_a">
        贷款期限
        <input checked="checked" placeholder="年" v-model="years_a"/><input checked="checked" placeholder="月" v-model="years_b"/>
      </div>
<!--      <button id="center_go">开始计算</button>
      <button id="center_to">重置数值</button>-->
    </div>
    <div class="right_a">
<!--      <img src="src/assets/logo.png" >-->
      <div>
        <button style="width: 500px;height: 49px;background-color: black;color: white">高利贷鉴别计算结果</button>
      </div>
      <div class="send_a">是否高利贷：{{isq}}</div>
      <div class="send_b">贷款年利率：{{yearsl.toFixed(4)}}</div>
      <div class="send_a">贷款月利率：{{monthsl.toFixed(4)}}</div>
    </div>
  </div>
</template>

<script>
export default {
  name: "Center_3",
  data() {
    return {
      input: '',
      moneys:'',
      moneys_s:'',
      years_a:'',
      years_b:'',

    }
  },
  computed:{
    isq(){
      const llv = (this.moneys_s/this.moneys/[parseInt(this.years_a)*12+parseInt(this.years_b)])*12
      /*利息率= (利息÷本金÷时间)×100%。*/
      if (llv>0.06){
        return "是"
      }
      /*return this.moneys*/
      return "否"
    },
    yearsl(){
      const lls = this.moneys===''||this.moneys_s===''||this.years_a===''||this.years_b===''
      if (lls){
        return 0
      }
      return (this.moneys_s/this.moneys/[parseInt(this.years_a)*12+parseInt(this.years_b)]/30)*365
    },
    monthsl(){
      const lls = this.moneys===''||this.moneys_s===''||this.years_a===''||this.years_b===''
      if (lls){
        return 0
      }
      return (this.moneys_s/this.moneys/[parseInt(this.years_a)*12+parseInt(this.years_b)])*12
    }
  }
}
</script>

<style scoped>

#center_text{
  margin: 30px 0 10px 0;
  width: 1100px;
  font-size: 18px;
  margin-left: 280px;
}
#center_text input{
  width: 220px;
  height: 49px;
  background-color: gainsboro;
  border:none;
  margin-left: 10px;
}
.right_a{
  width: 500px;
  height: 200px;
  float: right;
  background-color: gainsboro;
}
#center_go{
  width: 200px;
  height: 49px;
  border-radius: 8px;
  background-color: cornflowerblue;
  margin: 30px 0 10px 85px;
}
#center_to{
  width: 200px;
  height: 49px;
  border-radius: 8px;
  background-color: cornflowerblue;
  margin-left: 60px;
}
.send_a{
  width: 500px;
  height: 49px;
  background-color: gainsboro;
}
.send_b{
  width: 500px;
  height: 49px;
  background-color: white;
}
</style>